package nsu.edu.zsq.controller.student;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import nsu.edu.zsq.common.JsonData;
import nsu.edu.zsq.service.student.ExamInfoService;

/** 
* Description: 学生考试安排的controller类<br>
*/

@RequestMapping("/student/exam")
@Controller
public class ExamInfoController {
    
    @Autowired
    private ExamInfoService examInfoService;

    /**
     * 获取学生的考试信息
     * @return JsonData
     */
    @RequestMapping("/listExamStudent")
    @ResponseBody
    public JsonData listExamStudent(Model model) {
        List<Map<String, Object>> listExamStudent = examInfoService.listExamStudent();
        return JsonData.success(listExamStudent);
    }
    
    /**
     * 获取学生的补考信息
     * @return JsonData
     */
    @RequestMapping("/listResitExamStudent")
    @ResponseBody
    public JsonData listResitExamStudent(Model model) {
        List<Map<String, Object>> listExamStudent = examInfoService.listResitExamStudent();
        return JsonData.success(listExamStudent);
    }
}
